package li.webqq.api;

import li.http.Request;
import li.webqq.Const;
import li.webqq.util.StringUtil;

/**
 * http://www.qqxieyi.com/fenxi_show.asp?id=21
 */
public class GetUserFriends2Request extends Request implements Const {
    private String vfwebqq;

    private String qq;

    public void setQq(String qq) {
        this.qq = qq;
    }

    public void setVfwebqq(String vfwebqq) {
        this.vfwebqq = vfwebqq;
    }

    public GetUserFriends2Response execute() {
        String hash = StringUtil.hashWhenGetUserFriends2(this.qq, this.getCookie("ptwebqq"));
        String r = StringUtil.build(R_GET_USER_FRIENDS2, hash, vfwebqq);

        super.setUrl(URL_GET_USER_FRIENDS2);
        super.setReferer(URL_PROXY);
        super.setContentType(FORM_URLENCODED);

        super.setField("r", StringUtil.encode(r));
        // super.setField("clientid", CLIENT_ID);
        // super.setField("psessionid", "null");

        return super.execute(new GetUserFriends2Response());
    }
}